package com.bw.eureka.jpa.controller;


import com.bw.common.dto.UserDTO;
import com.bw.common.vo.ResultVO;
import com.bw.eureka.jpa.annotation.Log;
import com.bw.eureka.jpa.entity.UserEntity;
import com.bw.eureka.jpa.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author qpxbo
 * 用户controller
 */
@Api("用户功能接口")
@RestController
public class UserController {

    @Autowired
    UserService userService;

    @ApiOperation(value = "查询用户列表",tags = "根据id 排序 分页查询")
    @RequestMapping(value = "/user/list",method = RequestMethod.GET)
    @Log(value = "查询用户列表 根据id 排序 分页查询")
    public ResultVO getUserList(UserDTO userDTO){

        Page<UserEntity> userList = userService.getUserList(userDTO);
        return ResultVO.success(userList);
    }

}
